function syncToc()
{

var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1, sPath.indexOf('.htm'));
sPage = sPage.toLowerCase();


if (typeof(top.helpTOC.findArticle) != "undefined")
{
top.helpTOC.findArticle(sPage);
}
}
function on(o)
{
o.runtimeStyle.color = "#0000ff";
}
function off(o)
{
o.runtimeStyle.color = "";
}
function expand(o)
{
if (o.nextSibling.style.display == "none")
{
o.firstChild.src = "../imgs/d.gif";
o.nextSibling.style.display = "inline";
o.style.color = "#0000ff";
o.scrollIntoView();
}
else
{
o.firstChild.src = "../imgs/r.gif";
o.nextSibling.style.display = "none";
o.style.color = "#000000";
if ( LOCID_UI_DIR=="RTL" )
o.style.filter = "FlipH()" ;
}
}





function submitFeedback()
{
event.returnValue = false;
if (GetRating() == "None")
{
alert(top.bottomBar.fbNoRating_Text);
return false;
}

var pathFields = top.helpContents.location.pathname.split("/");

var sURL = pathFields[pathFields.length-1];

var sTitle = ParseTitle(document.title);

var sProductVer  = document.getElementById("ProdVersion").value;
var sDocVer      = document.getElementById("DocVersion").value;

var sDeliverable = document.getElementById("Deliverable").value;
if( sDeliverable == "" )
sDeliverable = pathFields[1];

var sSku = document.getElementById("Sku").value;
if( sSku == "" )
sSku = pathFields[3];
var sLang = document.getElementById("Language").value;
if( sLang == "" )
sLang = pathFields[2];

var sExtension = document.getElementById("CustomExtension").value;

var sSubject =  sTitle + ' (' + "/1:" + sDeliverable + "/2:" + sProductVer + "/3:" + sDocVer+ '/4:' +
sURL + '/5:' +  GetRating() + '/6:' + sLang + '/7:' + sSku + sExtension + ")";

var sBody = document.getElementById("fbResponseText").value;

if (sBody == "")
{
sBody = "---" + top.bottomBar.fbTypeHere_Text + "---";
}
location.href = "mailto:mscrmdf@microsoft.com" + '?subject=' + sSubject + '&body=' + sBody;
}
function ParseTitle(theTitle)
{
theTitle = theTitle.replace(/\"/g,"--");
theTitle = theTitle.replace(/'/g,"-");
if (theTitle == "") {theTitle = top.bottomBar.fbTitle_Text;}
if (theTitle.length > 50) {theTitle = theTitle.slice(0,47) + "...";}
return theTitle;
}
function GetRating()
{
if (fbRating[0].checked)
return "Yes";
else if (fbRating[1].checked)
return "No";

else
return "None";
}

function ScrollItemIntoView(sId)
{
var oElement = document.getElementById(sId);

if(typeof(oElement) != "undefined" && oElement != null)
{
oElement.scrollIntoView();
}
}
